<template>
  <UserInfoComp>
    <div>用户首页</div>
  </UserInfoComp>
  <hr />

  <div v-if="loginUser.login">
    <ElAvatar v-if="loginUser.tbUserInfo.img" :src="loginUser.tbUserInfo.img"></ElAvatar>
    <ElAvatar v-else src="https://ts1.cn.mm.bing.net/th/id/R-C.c92e1a02589a4997d30cc31694f5626a?rik=mn1NOkEsTONSow&riu=http%3a%2f%2fimage11.m1905.cn%2fuploadfile%2f2012%2f0810%2f20120810034421574.jpg&ehk=fNIwWPRC9NV4ABXqsHZc63piTXRzQitk%2f3FFhrtu8pA%3d&risl=&pid=ImgRaw&r=0"></ElAvatar>
    <span>电话：{{ loginUser.tbUserInfo.phone }}</span>
    <span>邮箱：{{ loginUser.tbUserInfo.email }}</span>
  </div>
  <div v-else> 用户未登录 </div>
</template>

<script lang="ts" setup>
import { ElAvatar } from 'element-plus'
import { storeToRefs } from 'pinia'
import { store } from '../../store/index'
import UserInfoComp from '../../components/UserInfoComp.vue'
const { loginUser } = storeToRefs(store())
</script>

<style lang="scss" scoped></style>
